<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>属性选择器CSS2.1</title>
    <style>
        /*  单词匹配  -  abc text   
        [foo]       所有属性
        [foo=abc]   等于
        [foo~=abc]  含有 abc text 两个单词    
        [foo|=abc]  开头 / abc- 开头   (abc efj)

        
        */
        /* [foo] {
            background-color: red;
        } 
 
        [foo=abc] {
            background-color: red;
        }
        */

        [foo|=abc] {
            background-color: red;
        }

        /* [foo~=abc] {
            background-color: red;
        }  */
    </style>
</head>

<body>
    <ul>
        <li foo>1</li>
        <li foo="abc">2</li>
        <li foo="abc-efj">3</li>
        <li foo="abcefj">4</li>
        <li foo="efjabc">5</li>
        <li foo="ab">6</li>
    </ul>
</body>

</html>